<%@ include file="connect.jsp" %>

<%
    String pert = request.getParameter("quewrite");
    String Ans = request.getParameter("answer");
    String idque = request.getParameter("idque");
    String idtest = request.getParameter("Testid");
    String img = request.getParameter("picture");
    String target = request.getParameter("option");
    String ganti = pert.replaceAll("'", "''");

    stat.executeUpdate("UPDATE DetailQuestion set Question = '"+ganti+"' ,Answer = '" + Ans + "', Images = lower('" + img + "'), Target = '"+target+"' where questionID = '" + idque + "' ");

    if (idtest.equals("1")) {

        response.sendRedirect("pretest.jsp?respon=Question has been updated!");
        conn.close();

    } else {

        response.sendRedirect("posttest.jsp?respon=Question has been updated!");
        conn.close();
    }


%>
